#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
WORKDIR /app
EXPOSE 80

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
COPY ["FC8280TServer/FC8280TServer.csproj", "FC8280TServer/"]
COPY ["FaceWebServer.Service/FaceWebServer.Service.csproj", "FaceWebServer.Service/"]
COPY ["FaceAPI.DB/FaceWebServer.DB.csproj", "FaceAPI.DB/"]
COPY ["FaceWebServer.Interface/FaceWebServer.Interface.csproj", "FaceWebServer.Interface/"]
COPY ["FaceWebServer.Utility/FaceWebServer.Utility.csproj", "FaceWebServer.Utility/"]
RUN dotnet restore "FC8280TServer/FC8280TServer.csproj"
COPY . .
WORKDIR "/src/FC8280TServer"
RUN dotnet build "FC8280TServer.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "FC8280TServer.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FC8280TServer.dll"]